import 'package:flutter/material.dart';

class HomeNav extends StatefulWidget {
  HomeNav({super.key, required this.navList});

  List navList = [];

  @override
  State<HomeNav> createState() => _HomeNavState();
}

class _HomeNavState extends State<HomeNav> {
  @override
  Widget build(BuildContext context) {
    return GridView.builder(
        gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
          crossAxisCount: 5,
          mainAxisSpacing: 0,
          crossAxisSpacing: 0,
          childAspectRatio: 1,
        ),
        // itemCount: widget.navList.length,
        itemCount: 10,
        shrinkWrap: true,
        itemBuilder: (context, index) {
          return Container(
            color: Colors.white,
            alignment: Alignment.center,
            child: Container(
              child: Column(
                children: [
                  Expanded(
                      child: Image.network(
                    widget.navList[index]['imgUrl'],
                    width: 60,
                    height: 60,
                    fit: BoxFit.contain,
                  )),
                  Expanded(
                      child: Text(
                    widget.navList[index]['text'],
                    style: const TextStyle(fontSize: 13),
                  ))
                ],
              ),
            ),
          );
        });
  }
}
